#ifndef __VIDEO_CONTEXT_H__
#define __VIDEO_CONTEXT_H__
#include "video.h"

class VideoContext
{
private:
	mutex m_lock;
	queue<AVFrame*> m_queue;
public:
	atomic_bool m_vCaptureRunning;
	atomic_bool m_vEncodeRunning;
	int m_nWidth;
	int m_nHeight;
	HANDLE m_event;
	VideoContext();
	virtual ~VideoContext();

	UINT GetSize();
	void PushFrame(AVFrame*);
	AVFrame* PullFrame();
};

bool SetOK();

UINT GetVFrameSize();

void PushAVFrame(AVFrame* pFrame);

AVFrame* PullAVFrame();

void SetCtxValue(int width, int height);

void GetCtxValue(int& width, int& height);

extern VideoContext* g_vcapture_ctx;
#endif
